package com.caht.controller.user;

import com.caht.entity.Topic;
import com.caht.result.Result;
import com.caht.servier.TopicServier;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/***
 * 话题接口
 */
@RestController
@RequestMapping("/user/topic")
@Slf4j
public class TopicController {
    @Autowired
    private TopicServier topicServier;
    /**
     * 获取所有话题
     * @return
     */
    @GetMapping
    public Result<List<Topic>> getTopicAll(){
        List<Topic> topics = topicServier.GetTopicAll();
        return Result.success(topics);
    }
}
